/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


$(document).ready(function() {
    $("#formAdd").submit(function(event) {
        $.ajax({
            url: "/SocialNetwork/AddUser",
            type: 'POST',
            data: {
                fname: $('input[name=fname]').val(),
                lname: $('input[name=lname]').val(),
                email: $('input[name=email]').val(),
            },
            success: function(data) {
                $.fancybox.close();
                $("#alert").html(data);
            },
            beforeSend: function() {
                $(".fancybox").click();
            }

        });
        return false;
    });
});

